package jvm.oom;

/**
 * todo
 *
 * @author: luolidong
 * @create: 2021-07-15 15:52
 * @version: 1.0
 */

import java.util.ArrayList;
import java.util.List;

/*** VM Args：-Xms20m -Xmx20m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=D:\oom **/
public class HeapOOM {
    static class OOMObject {
    }

    public static void main(String[] args) {
        List<OOMObject> list = new ArrayList<OOMObject>();
        while (true) {
            list.add(new OOMObject());
        }
    }
}
